/* Check JER_Matrix::Invertible(). */
#include <stdio.h>
#include "jerasure.h"
#include "reed_sol.h"

int main( int argc, char** argv )
{
	int *old_bitmatrix;
	int *inverse_matrix;
	int i, j;
	int m = atoi( argv[1] );
	int k = atoi( argv[2] );
	int w = atoi( argv[3] );
	
	i = 1 << w;
	srand48(m);
	inverse_matrix = (int*) malloc( sizeof(int) * k * k );
	for( j = 0; j < k * k; j++ )
		inverse_matrix[j] = lrand48() % i;
	if( jerasure_invertible_matrix( inverse_matrix, k, w ) )
		fprintf( stdout, "This matrix is invertible\n" );

	return 0;
}
